package com.weixin.converter;

import com.weixin.dto.OrderDto;
import com.weixin.pojo.OrderMaster;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author CJunGod
 * @create 2020-03-01 19:58
 **/
public class OrderMaster2OrderDtoConverter {

    public  static OrderDto convert(OrderMaster orderMaster){
        OrderDto orderDto = new OrderDto();
        orderDto.setMaster(orderMaster);

        return orderDto;
    }

    public static List<OrderDto> convert(List<OrderMaster> orderMaster){
        return  orderMaster.stream().map(o ->
            convert(o)
        ).collect(Collectors.toList());

    }
}
